package com.iflytek.springboot_medicine.controller;


import com.iflytek.springboot_medicine.common.Page;
import com.iflytek.springboot_medicine.entity.Operation;
import com.iflytek.springboot_medicine.pojo.ResponseMessage;
import com.iflytek.springboot_medicine.service.impl.OperationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/operation")
public class OperationController {

    @Autowired
    OperationServiceImpl operationService;

    @GetMapping("/selectByPage")
    public ResponseMessage select(
            @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
            @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {

        Page<Operation> page = operationService.selectOperations(pageNum,pageSize);

        return ResponseMessage.success(page);
    }


}
